package code.structure.manager.background
{
	import flash.utils.Dictionary;

	/**
	 *游戏背景管理器 
	 * @author Yuri
	 * 
	 */
	public class BackGroundManager
	{
		private var _bgDic:Dictionary;
		
		private static var _instance:BackGroundManager;
		/**
		 *背景路径 
		 */
		public static var bgPath:String = "files/bg/";
		public function BackGroundManager()
		{
			if(_instance){ 
				throw new Error("实例化单例类出错-BackGroundManager");
			}else{
				init();
			}
		}
		
		private function init():void{
			_bgDic = new Dictionary();
		}
		
		public static function getInstance():BackGroundManager{
			if(!_instance) _instance = new BackGroundManager();
			return _instance;
		}
		
		/**
		 *解析数据 
		 * @param d
		 * 
		 */
		public function parserData(d:Object):void{
			init();
			for(var key:String in d){
				_bgDic[key] = d[key];
			}
		}

		public function get bgDic():Dictionary
		{
			return _bgDic;
		}

	}
}